package com.liwq.base.sync;

/**
 * @author : liwq
 * @version : 1.0
 * @date : 2023/1/29
 **/
public class LockTest {


    public static void main(String[] args) {

        LockTicket ticket = new LockTicket();

        new Thread(() -> {
            for (int i = 0; i < 30; i++) {
                ticket.sale();
            }
        }, "AA").start();


        new Thread(() -> {
            for (int i = 0; i < 30; i++) {
                ticket.sale();
            }
        }, "BB").start();

        new Thread(() -> {
            for (int i = 0; i < 30; i++) {
                ticket.sale();
            }
        }, "CC").start();


    }
}
